Skip to content

Conversation

@mutianf
Copy link
Contributor

@mutianf mutianf commented Dec 23, 2025

…lient

Use the same background executor in monitoring client and OpenTelemetry Periodic readers as the bigtable client. This executor is only used for background tasks, so monitoring client is still gonna have different executors for its channels.

Since we convert the background executor to a fixed executor provider, we need to add it back to the background resources to auto close it.

@mutianf mutianf requested review from a team as code owners December 23, 2025 02:37
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigtable Issues related to the googleapis/java-bigtable API. labels Dec 23, 2025
@mutianf mutianf requested a review from a team as a code owner December 23, 2025 17:15

settingsBuilder.setUniverseDomain(universeDomain);

if (executorService != null) {
Copy link
Contributor

@igorbernstein2 igorbernstein2 Dec 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when is this null? add a comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment doesnt explain why executorService would be null

* endpoint.
*/
public static void registerBuiltinMetrics(
@Nullable Credentials credentials, SdkMeterProviderBuilder builder, @Nullable String endpoint)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this method be deprecated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, we just marked everything else with project id as deprecated since project id is not used anymore. Also the whole class is deprecated because we want to encourage poeple to move to CustomOpenTelemetryMetricsProvider

igorbernstein2
igorbernstein2 previously approved these changes Dec 23, 2025
Copy link
Contributor

@igorbernstein2 igorbernstein2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm after comments are addressed

// if the background executor in the settings is already a FixedExecutorProvider,
// we can't assume that we can autoclose it and the life cycle should be managed
// by the application
canAutoCloseExecutor = false;
Copy link
Contributor

@igorbernstein2 igorbernstein2 Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create our own implementation of the ExecutorProvider with a settable bit for shouldAutoClose and use that instead of the FixedExecutorProvider? This way we can localize the lifecycle management instead of messing around with background resources?

But still passing a FixedExecutorProvider to the child clients like metrics?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the googleapis/java-bigtable API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants